{extend name='layout'}

{block name='content'}
<div class="col-sm-8">
    <blockquote>
        <p>
            <img src="{$avatar? '/uploads/'.$avatar : ''}" alt="未设置照片"
                class="img-rounded" style="border-radius:500px; height: 40px"> {$user_info.nickname} <br>
            {if $user_info.uid !== $Think.session.uid}
            <!--<button class="btn btn-primary like-button" like-value="1" like-user="{$user_info.uid}">关注</button>-->
                {if count($user_info->has_follow)} <!--已关注-->
                    <button class="btn btn-default like-button" like-value="0" like-user="{$user_info.uid}" type="button">取消关注</button>
                {else/}
                    <button class="btn btn-primary like-button" like-value="1" like-user="{$user_info.uid}" type="button">关注</button>
                {/if}
            {/if}
        </p>


        <footer>关注：{$counts.follows_count}｜粉丝：{$counts.fans_count}｜文章：{$counts.posts_count}</footer>
    </blockquote>
</div>
<div class="col-sm-8 blog-main">
    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">文章</a></li>
            <li class=""><a href="#tab_2" data-toggle="tab" aria-expanded="false">关注</a></li>
            <li class=""><a href="#tab_3" data-toggle="tab" aria-expanded="false">粉丝</a></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="tab_1">
                {volist name="posts" id="post"}
                <div class="blog-post" style="margin-top: 30px">
                    <!--<p class=""><a href="/user/5">Kassandra Ankunding2</a> 6天前</p>-->
                    <p class=""><a href="/posts/{$post.id}/show">{$post.title}</a>   {$post.update_time|date="m-d H:i"}</p>

                    <p>
                        {:str_limit(strip_tags($post.content),30)}
                    </p>
                </div>
                {/volist}

                {$posts|raw}
            </div>
            <!-- /.tab-pane -->
            <div class="tab-pane" id="tab_2">
                {volist name="follows" id="follow"}
                <div class="blog-post" style="margin-top: 30px">
                    <p class=""><a href="/user/{$follow->followed_user}">{$follow->f_user->nickname}</a></p>
                    <p class="">关注：{:count($follow->f_user_f)} | 粉丝：{:count($follow->f_user_fans)}｜ 文章：{:count($follow->f_posts)}</p>

                    <div>
                    {if $Think.session.uid !== $follow->followed_user}
                        <!--当前登录用户是否关注了此人信息-->
                        {if count($follow->hasFollow)} <!--已关注-->
                        <button class="btn btn-default like-button" like-value="0" like-user="{$follow->f_user->uid}" type="button">取消关注</button>
                        {else/}
                        <button class="btn btn-primary like-button" like-value="1" like-user="{$follow->f_user->uid}" type="button">关注</button>
                        {/if}
                    {/if}
                    </div>
                </div>
                {/volist}

                {$follows|raw}
            </div>
            <!-- /.tab-pane -->
            <div class="tab-pane" id="tab_3">
                {volist name="fans" id="fan"}
                <div class="blog-post" style="margin-top: 30px">
                    <p class=""><a href="/user/{$fan->fan_id}">{$fan->fan_user->nickname}</a></p>
                    <p class="">关注：{:count($fan->fan_followers)} | 粉丝：{:count($fan->fan_fans)}｜ 文章：{:count($fan->fan_posts)}</p>

                    <div>
                    {if $Think.session.uid !== $fan->fan_id}
                        <!--当前登录用户是否关注了此人信息-->
                        {if count($fan->has_follow)} <!--已关注-->
                        <button class="btn btn-default like-button" like-value="0" like-user="{$fan->fan_id}" type="button">取消关注</button>
                        {else/}
                        <button class="btn btn-primary like-button" like-value="1" like-user="{$fan->fan_id}" type="button">关注</button>
                        {/if}
                    {/if}
                    </div>
                </div>
                {/volist}
                {$fans|raw}
            </div>
            <!-- /.tab-pane -->
        </div>
        <!-- /.tab-content -->
    </div>


</div><!-- /.blog-main -->
{/block}

{block name="footerscript"}
{js href="/static/js/frontend/user/index.js"}
{/block}